echo -e "\033[31m ####################### 安装 Docker 服务 ####################### \033[0m"  
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum -y install docker-ce-20.10.7-3.el7
systemctl daemon-reload && systemctl restart docker && systemctl enable docker

echo -e "\033[31m ####################### 安装 Docker Compose 服务 ####################### \033[0m"  
curl -L "https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

echo -e "\033[31m ####################### 设置 Docker 镜像加速 ####################### \033[0m" 
cat > /etc/docker/daemon.json <<EOF
{
  "registry-mirrors": ["https://anhym31c.mirror.aliyuncs.com"],
  "log-opts": {
    "max-size": "1024m"
  }
}
EOF
systemctl daemon-reload && systemctl restart docker